Component({
  properties: {
    color: { type: String, value: '#333' },
    selectedColor: { type: String, value: getApp().globalData.theme },
    select: { type: Number, value: 0 }
  },
  data: {
    list: [
      {
        pagePath: "pages/index/index",
        text: "首页",
        iconPath: "/dink/images/all.png",
        selectedIconPath: "/dink/images/all-fill.png"
      }, 
      {
        pagePath: "pages/test/test",
        text: "测试",
        iconPath: "/dink/images/home.png",
        selectedIconPath: "/dink/images/home-fill.png"
      },
      {
        pagePath: "pages/logs/logs",
        text: "我的",
        iconPath: "/dink/images/account.png",
        selectedIconPath: "/dink/images/account-fill.png"
      }
    ]
  },
  methods: {
    switchTab(e) {
      const data = e.currentTarget.dataset
      const url = '/' + data.path
      wx.switchTab({url})
    }
  }
})